3.212 \(\int \frac {\cot (x)}{-\cot (x)+\csc (x)} \, dx\)

Optimal. Leaf size=16 \[ -x-\frac {\sin (x)}{1-\cos (x)} \]

[Out]

-x-sin(x)/(1-cos(x))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4392, 2735, 2648} \[ -x-\frac {\sin (x)}{1-\cos (x)} \]

Antiderivative was successfully verified.

[In]

Int[Cot[x]/(-Cot[x] + Csc[x]),x]

[Out]

-x - Sin[x]/(1 - Cos[x])

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 4392

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {\cot (x)}{-\cot (x)+\csc (x)} \, dx &=\int \frac {\cos (x)}{1-\cos (x)} \, dx\\ &=-x+\int \frac {1}{1-\cos (x)} \, dx\\ &=-x-\frac {\sin (x)}{1-\cos (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 16, normalized size = 1.00 \[ \frac {1}{2} \left (-2 x-2 \cot \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]/(-Cot[x] + Csc[x]),x]

[Out]

(-2*x - 2*Cot[x/2])/2

________________________________________________________________________________________

fricas [A]  time = 0.69, size = 14, normalized size = 0.88 \[ -\frac {x \sin \relax (x) + \cos \relax (x) + 1}{\sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(-cot(x)+csc(x)),x, algorithm="fricas")

[Out]

-(x*sin(x) + cos(x) + 1)/sin(x)

________________________________________________________________________________________

giac [A]  time = 0.16, size = 12, normalized size = 0.75 \[ -x - \frac {1}{\tan \left (\frac {1}{2} \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(-cot(x)+csc(x)),x, algorithm="giac")

[Out]

-x - 1/tan(1/2*x)

________________________________________________________________________________________

maple [A]  time = 0.07, size = 13, normalized size = 0.81 \[ -\frac {1}{\tan \left (\frac {x}{2}\right )}-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(-cot(x)+csc(x)),x)

[Out]

-1/tan(1/2*x)-x

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 23, normalized size = 1.44 \[ -\frac {\cos \relax (x) + 1}{\sin \relax (x)} - 2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(-cot(x)+csc(x)),x, algorithm="maxima")

[Out]

-(cos(x) + 1)/sin(x) - 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

mupad [B]  time = 0.58, size = 10, normalized size = 0.62 \[ -x-\mathrm {cot}\left (\frac {x}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-cot(x)/(cot(x) - 1/sin(x)),x)

[Out]

- x - cot(x/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \int \frac {\cot {\relax (x )}}{\cot {\relax (x )} - \csc {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(-cot(x)+csc(x)),x)

[Out]

-Integral(cot(x)/(cot(x) - csc(x)), x)

________________________________________________________________________________________